package com.base.cn.platform.os.service.manage.user.account;

import com.base.cn.platform.os.service.FeignAuthConfig;
import com.base.cn.platform.os.service.manage.BaseService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.Map;

/**
 *  用户账户接口
 *
 * @author ll
 * @create 2018-04-25
 */
@FeignClient(value = BaseService.appName,configuration = FeignAuthConfig.class)
public interface CusUserAccountService extends BaseService {

    /**
     * 分页搜索账户列表
     * @param currentPage 分页
     * @return
     */
     @RequestMapping(contextPath + "/user/queryCusUserAccountListPage")
     Map<String,Object> queryCusUserAccountListPage(@RequestBody Map<String, Object> userContainColumns,
                                                    @RequestParam("currentPage") Integer currentPage);



    /**
     * 操作账户金额
     * type=1银行充值，type=2银行冻结金额,type=3银行解冻金额
     * type=4充值卡入账,type=5充值卡冻结金额,type=6充值卡解冻金额
     * type=7银行扣款，type=8充值卡扣款
     * @param id 账户ID
     * @param type 操作类型
     * @param amount 操作金额
     * @return Map<String , Object>
     */

    @RequestMapping(contextPath + "/user/updateUserAccountAmount")
    Map<String, Object> updateUserAccountAmount(@RequestParam("createUserId") BigDecimal createUserId,
                                                @RequestParam("id") BigDecimal id,
                                                @RequestParam("type") int type,
                                                @RequestParam("amount") double amount);

    /**
     * 修改账户状态
     * @param status  状态，ACTIVE正常，FROZEN冻结
     * @param id 账户 ID
     * @return Map<String , Object>
     */
    @RequestMapping(contextPath + "/user/updateUserAccountStatus")
    Map<String,Object> updateUserAccountStatus(@RequestParam("status") String status,
                                               @RequestParam("id") BigDecimal id);


    /**
     * 查看账户详情
     * @param userId
     * @return 显示页面
     */
    @RequestMapping(contextPath + "/user/userAccountInfo")
    Map<String,Object> userAccountInfo(@RequestParam("userId") BigDecimal userId, @RequestParam("userData") boolean userData);

    /**
     * 账户入账,充值 入款，出账.消费
     *
     * @param userId             学员用户id
     * @param trxAmount          　交易金额
     * @param accountType        　账户操作类型，cash or vm
     * @param accountHistoryType 　账户历史记录类型
     * @param orderId            　订单号,订单表主键id
     * @param orderNo            　订单号,对系统的的
     * @param outTradeNo         　提交到支付宝的,(充值卡是用卡号)
     * @param isDisplay          　在用户我的账户历史中是否显示 0显示 1不显示
     * @param accountBizType     　交易类型，课程、会员、图书等
     * @param createUserId          后台管理ID
     * @param status             1.出账 2.进账
     */
    @RequestMapping(contextPath + "/user/updateAccountMoney")
    void updateAccountMoney(@RequestParam("userId") BigDecimal userId,
                            @RequestParam("trxAmount") double trxAmount,
                            @RequestParam("accountType") String accountType,
                            @RequestParam("accountHistoryType") String accountHistoryType,
                            @RequestParam("orderId") BigDecimal orderId,
                            @RequestParam(value = "orderNo", required = false) String orderNo,
                            @RequestParam(value = "outTradeNo", required = false) String outTradeNo,
                            @RequestParam("isDisplay") boolean isDisplay,
                            @RequestParam("accountBizType") String accountBizType,
                            @RequestParam("createUserId") BigDecimal createUserId,
                            @RequestParam("status") int status);
}
